<?php
class CreateUsers extends CakeMigration {

/**
 * Migration description
 *
 * @var string
 * @access public
 */
	public $description = '';

/**
 * Actions to be performed
 *
 * @var array $migration
 * @access public
 */
	public $migration = array(
		'up' => array(
			'create_table' => array(
					'users' => array(
						  'id' => array('type'    =>'integer',
											      'null'    => false,
														'key'			=> 'primary'),
						  'email' => array('type' => 'string', 'null' => false),
							'password' => array('type' => 'string', 'null' => false),
							'status'	=> array('type' => 'integer', 'null' => false, 'default' => 0),
							'role_id' => array('type' => 'integer', 'null' => false),
							'email_verified' => array('type' => 'integer', 'null' => false, 'default' => 0),
							'email_token' => array('type' => 'string'),
							'created_at' => array('type' => 'datetime'),
			        'updated_at' => array('type' => 'datetime'),
							'created_by' => array('type' => 'integer'),
						  'indexes' => array(
						      'PRIMARY' => array(
						          'column' => 'id',
						          'unique' => 1)
						  )
					)
				)
		),
		'down' => array(
			'drop_table' => array('users')
		),
	);

/**
 * Before migration callback
 *
 * @param string $direction, up or down direction of migration process
 * @return boolean Should process continue
 * @access public
 */
	public function before($direction) {
		return true;
	}

/**
 * After migration callback
 *
 * @param string $direction, up or down direction of migration process
 * @return boolean Should process continue
 * @access public
 */
	public function after($direction) {
		return true;
	}
}
